#ifndef SSY_MYSQL_DATABASE_H
#define SSY_MYSQL_DATABASE_H


#include "mysql/mysql.h"
#include "violate_data.h"

#define CATEGORY_LOGO       1001
#define CATEGORY_CHEXI      1002
#define CATEGORY_CHEXING    1003
#define CATEGORY_VIOTYPE    1004
#define CATEGORY_CARTYPE    1005
#define CATEGORY_CARCOLOR   1006

bool Mysql_Init(const char *p_host, const int port, const char *p_user, const char *p_passwd, MYSQL **pp_handle);
void Mysql_Uninit(const MYSQL *pc_handle);
bool Mysql_HasTable(const MYSQL *pc_handle, const char *p_db_name, const char *p_table_name);
bool Mysql_PrintTables(const MYSQL *pc_handle, const char *p_db_name, const char *p_table_name);
bool Mysql_ExecuteFile(const MYSQL *pc_handle, const char *p_file_path);
bool Mysql_ReadCategory(const MYSQL *pc_handle, const int catagoryStyle, const int categoryIndex, char *p_categoryName);
bool Mysql_WriteAlarm(const MYSQL *pc_handle, const t_VioData *p_vio_data);


#endif // SSY_MYSQL_DATABASE_H

